Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for circular references in datacontract objects #303

Merged
merged 4 commits into from
Aug 8, 2019

Conversation

apatenotre
Copy link
Contributor

@apatenotre apatenotre commented Aug 3, 2019

Fixes #302

Solution : store type in dictionary before the recursive call

@kotovaleksandr
Copy link
Member

Hi @apatenotre Please, fix conflicts. Thanks for your help!

@apatenotre apatenotre changed the title Add support for circular references in datacontract objects WIP: Add support for circular references in datacontract objects Aug 5, 2019
@apatenotre
Copy link
Contributor Author

Hi @kotovaleksandr,
work in progress, will fix this tonight and let you know!

@apatenotre apatenotre changed the title WIP: Add support for circular references in datacontract objects Add support for circular references in datacontract objects Aug 5, 2019
@apatenotre
Copy link
Contributor Author

Hi @apatenotre Please, fix conflicts. Thanks for your help!

All good

@apatenotre apatenotre changed the title Add support for circular references in datacontract objects WIP: Add support for circular references in datacontract objects Aug 6, 2019
@apatenotre
Copy link
Contributor Author

Actually, moving it back to WIP as I think I found a regression. I will clean it tomorrow

The idea is to avoid using _complexTypeToBuild, as it is set just before DiscoveryTypesByProperties is called. So it can include types that have not yet been discovered.
Instead, a new hashset is introduced, dedicated to the tracking of discovered objects. Therefore, circular references never end up in StackOverflowException anymore
@apatenotre
Copy link
Contributor Author

Ok, should be good now.
The idea is that tracking of objects discovered while building the wsdl was incorrectly done. _complexTypeToBuild was used to detect circular references, but was set even before the type was read for the first time. So types could be skipped when they were not root while discovered. So I introduced a dedicated hashset

@apatenotre apatenotre changed the title WIP: Add support for circular references in datacontract objects Add support for circular references in datacontract objects Aug 7, 2019
@kotovaleksandr kotovaleksandr merged commit 043375b into DigDes:develop Aug 8, 2019
@apatenotre apatenotre deleted the SupportCircularReference branch August 9, 2019 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for circular references in data contracts
2 participants